﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Game.Foundation;

namespace Game.Client.ChineseChess
{
    static class Program
    {
        public static int RemotePort { get; private set; }
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (args.Length != 4)
            {
                foreach (string arg in args)
                {
                    MessageBox.Show(arg);
                }
                return;
            }

            RemotePort = int.Parse(args[3]);
            string configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Client.ChineseChess.exe.config");
            System.Runtime.Remoting.RemotingConfiguration.Configure(configFile, false);

            ChineseChessGameForm gameForm = new ChineseChessGameForm(args[0], args[1], int.Parse(args[2]));
            Application.Run(gameForm);
        }
    }
}
